# A plotting R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages( "ggplot2" ); library( ggplot2 ); # -------------------------------------------------------------------------- # If you don't have the scales package installed, uncomment the following line: # install.packages( "scales" ); library( scales ); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","log10_p_value","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0000375","RNA splicing, via transesterification reactions", 0.040,-1.884, 6.874, 3.659,-2.7994,0.854,0.000), c("GO:0006812","cation transport", 2.853, 2.480,-5.141, 5.512,-1.5280,0.944,0.000), c("GO:0048736","appendage development", 0.023,-1.204,-6.427, 3.421,-1.7198,0.637,0.000), c("GO:0019637","organophosphate metabolic process", 0.866,-6.149,-4.962, 4.995,-1.1907,0.965,0.009), c("GO:0022618","ribonucleoprotein complex assembly", 0.047,-6.196, 0.698, 3.731,-2.1906,0.669,0.016), c("GO:0006974","response to DNA damage stimulus", 1.944, 2.973,-0.501, 5.345,-1.4152,0.914,0.021), c("GO:0016337","cell-cell adhesion", 0.097,-0.571, 2.983, 4.044,-1.1834,0.946,0.023), c("GO:0022402","cell cycle process", 0.220,-4.468, 5.465, 4.400,-1.3218,0.880,0.025), c("GO:0006650","glycerophospholipid metabolic process", 0.226, 2.240, 6.731, 4.410,-2.7763,0.693,0.044), c("GO:0006004","fucose metabolic process", 0.041,-2.497,-2.143, 3.670,-1.3947,0.931,0.044), c("GO:0001932","regulation of protein phosphorylation", 0.196, 5.652, 2.266, 4.348,-1.4969,0.829,0.116), c("GO:0002260","lymphocyte homeostasis", 0.005, 6.764,-0.075, 2.788,-1.3947,0.872,0.200), c("GO:0051052","regulation of DNA metabolic process", 0.125, 4.499, 2.424, 4.154,-1.4178,0.835,0.335), c("GO:0006811","ion transport", 3.736, 1.139,-4.122, 5.629,-1.5794,0.953,0.400), c("GO:0007308","oocyte construction", 0.002,-2.003,-6.046, 2.386,-1.3947,0.607,0.435), c("GO:0050818","regulation of coagulation", 0.007, 4.044,-3.348, 2.914,-1.0738,0.726,0.464), c("GO:0032846","positive regulation of homeostatic process", 0.006, 6.640,-0.893, 2.812,-1.1539,0.904,0.474), c("GO:0008358","maternal determination of anterior/posterior axis, embryo", 0.002,-0.761,-6.620, 2.272,-1.1539,0.664,0.482), c("GO:0019216","regulation of lipid metabolic process", 0.035, 4.006, 4.295, 3.602,-1.7200,0.747,0.495), c("GO:0002683","negative regulation of immune system process", 0.018, 6.469, 0.825, 3.318,-1.2643,0.870,0.527), c("GO:0010927","cellular component assembly involved in morphogenesis", 0.019,-4.954,-1.437, 3.332,-1.7200,0.510,0.542), c("GO:0035108","limb morphogenesis", 0.017,-1.558,-6.466, 3.281,-1.7022,0.615,0.547), c("GO:0000070","mitotic sister chromatid segregation", 0.007,-5.697, 2.430, 2.894,-1.4152,0.665,0.555), c("GO:0030030","cell projection organization", 0.278,-6.121, 0.995, 4.500,-1.3694,0.656,0.567), c("GO:0006816","calcium ion transport", 0.081, 3.024,-5.687, 3.966,-1.6812,0.947,0.593), c("GO:0046486","glycerolipid metabolic process", 0.243, 1.925, 6.752, 4.443,-2.6502,0.752,0.612), c("GO:0009968","negative regulation of signal transduction", 0.092, 5.379, 0.659, 4.022,-1.1394,0.856,0.627), c("GO:0000819","sister chromatid segregation", 0.007,-5.802, 2.203, 2.917,-1.4152,0.657,0.639), c("GO:0006323","DNA packaging", 0.318,-4.861, 2.000, 4.559,-1.1139,0.613,0.660), c("GO:0034728","nucleosome organization", 0.190,-6.179, 1.357, 4.335,-1.3377,0.630,0.686), c("GO:0008610","lipid biosynthetic process", 1.950, 1.871, 6.565, 5.347,-1.5788,0.743,0.698)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");